﻿
using System.Collections.Generic;
using System.Runtime.Serialization;

namespace Clarendon.AzureBilling.Library
{
    /// <summary>
    /// A class used to create a relationship between a particular hosted service and a set of deployments 
    /// </summary>
    internal class DeploymentHost
    {
        /// <summary>
        /// The deployments hosted by the service
        /// </summary>
        internal List<Deployment> Deployments;
        /// <summary>
        /// The name of the hosted service
        /// </summary>
        internal string HostedServiceName;

        /// <summary>
        /// Constructor used to hold a hosted service name and a list of deployments
        /// </summary>
        public DeploymentHost(string hostedServiceName, List<Deployment> deployments)
        {
            HostedServiceName = hostedServiceName;
            Deployments = deployments;
        }
    }
    /// <summary>
    /// Contains the necessary properties to support a hosted service and map onto the XML of the same
    /// </summary>
    [DataContract]
    public class Deployment
    {
        /// <summary>
        /// Default constructor
        /// </summary>
        public Deployment()
        {
        }

        /// <summary>
        /// Overloaded constructor used to determine the name of the service
        /// </summary>
        public Deployment(string name)
        {
            Name = name;
        }

        /// <summary>
        /// Property to hold the name of the service
        /// </summary>
        [DataMember]
        public string Name { get; set; }
        /// <summary>
        /// This is the URL of the service - either staging or production
        /// </summary>
        [DataMember]
        public string Url { get; set; }
        /// <summary>
        /// This is the status of the Deployment
        /// </summary>
        [DataMember]
        public string Status { get; set; }
        /// <summary>
        /// A list of role instances configured as per the deployment
        /// </summary>
        [DataMember]
        public List<RoleInstance> RoleInstanceList { get; set; }
    }
}
